package com.hunan.api.catv.entity.enums;


public enum TpnsContentType {

    news(1, "短视频"),
    video(2, "点播"),
    tv(3, "电视台"),
    live(4, "慢直播"),
    activity(5, "活动"),
    h5(6, "H5跳转");

    private final Integer code;

    private final String value;


    TpnsContentType(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static Channel getResult(int code) {
        Channel[] rcs = Channel.values();
        for (Channel rc : rcs) {
            if (rc.getCode() == code) {
                return rc;
            }
        }
        return null;
    }

    public static String getValue(String code) {
        Channel[] rcs = Channel.values();
        for (Channel rc : rcs) {
            if (rc.getCode().toString().equals(code)) {
                return rc.getValue();
            }
        }
        return null;
    }
}
